/*
 * @Description: 
 * @Author: 于子续
 * @Date: 2024-09-04 14:55:36
 * @LastEditors: 于子续
 * @LastEditTime: 2024-09-04 16:12:18
 */
package day08;

import java.util.Scanner;
import java.util.Arrays;

public class Test03{
    public static void main(String[] args) {
        int i = 0;
        Scanner in = new Scanner(System.in);

        System.out.println("请输入数据并用空格分隔！");
        String tmp = in.nextLine();//将一行数据读出
        String arr[] = tmp.split("\\s+");//使用正则表达式将字符串分割 “\\s+”表示多个空格

        int arr1[] = new int[arr.length];


        for (String s : arr) {
            arr1[i] = Integer.parseInt(s);//将字符串转换为int数组
            i++;
        }
        System.out.println(Arrays.toString(arr1)+"的最大值为："+extracted(arr1));
    }



        private static double extracted ( int[] arr){
            double max=0;
            for (int i : arr) {
               if( max < i){
                max=i;

               }
            }
            return max;
        }


}